package com.msdy.androidwheel.test.demo;

import android.app.Activity;
import android.os.Bundle;

import com.msdy.androidwheel.test.R;

import msdy.com.androidwheel.widget.WheelView;
import msdy.com.androidwheel.widget.adapters.ArrayWheelAdapter;

public class CityActivity extends Activity
{
    protected WheelView WheelView1;
    protected WheelView WheelView2;
    protected WheelView WheelView3;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        super.setContentView(R.layout.view_citypicker);
        initView();
    }

    private void initView()
    {
        WheelView1 = (WheelView) findViewById(R.id.WheelView_1);
        WheelView2 = (WheelView) findViewById(R.id.WheelView_2);
        WheelView3 = (WheelView) findViewById(R.id.WheelView_3);

        // WheelView1.setVisibleItems(3);

        WheelView1.setVisibleItems(7); // Number of items
        // WheelView1.setWheelBackground(R.drawable.wheel_bg_holo);
        // WheelView1.setWheelForeground(R.drawable.wheel_val_holo);
        // WheelView1.setShadowColor(0xFF000000, 0x88000000, 0x00000000);
        // WheelView1.setShadowColor(0xDDFFFFFF, 0xBBFFFFFF, 0x00FFFFFF);
        // WheelView1.setViewAdapter(new CityAdapter(this));
        String[] items = new String[]{"123", "456", "789", "abc", "sdf", "sss", "aa"};
        ArrayWheelAdapter<String> adapter = new ArrayWheelAdapter<>(this, items);
        WheelView1.setViewAdapter(adapter);
        WheelView1.setCurrentItem(1);
        adapter.setTextSize(20);

        String[] items_2 = new String[]{"123", "456", "789"};
        ArrayWheelAdapter<String> adapter_2 = new ArrayWheelAdapter<>(this, items_2);
        WheelView2.setViewAdapter(adapter_2);
        WheelView2.setCurrentItem(1);

        String[] items_3 = new String[]{"123", "456", "789"};
        ArrayWheelAdapter<String> adapter_3 = new ArrayWheelAdapter<>(this, items_3);
        WheelView3.setViewAdapter(adapter_3);
        WheelView3.setCurrentItem(1);
        // WheelView3.setDrawShadows(false);
    }
}
